home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / enter-2004-01.iso / files / maxima-5.9.0.exe / {app} / share / maxima / 5.9.0 / src / numerical / slatec / dbesy0.lisp < prev    next >
Encoding:
Text File  |  2003-02-09  |  3.1 KB  |  72 lines

  1. ;;; Compiled by f2cl version 2.0 beta 2002-05-06
  2. ;;; 
  3. ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
  4. ;;;           (:coerce-assigns :as-needed) (:array-type ':simple-array)
  5. ;;;           (:array-slicing nil) (:declare-common nil)
  6. ;;;           (:float-format double-float))
  7.  
  8. (in-package "SLATEC")
  9.  
  10.  
  11. (let ((nty0 0)
  12.       (xsml 0.0)
  13.       (by0cs (make-array 19 :element-type 'double-float))
  14.       (twodpi 0.6366197723675814)
  15.       (first nil))
  16.   (declare (type f2cl-lib:logical first)
  17.            (type (simple-array double-float (19)) by0cs)
  18.            (type double-float twodpi xsml)
  19.            (type f2cl-lib:integer4 nty0))
  20.   (f2cl-lib:fset (f2cl-lib:fref by0cs (1) ((1 19))) -0.011277839392865573)
  21.   (f2cl-lib:fset (f2cl-lib:fref by0cs (2) ((1 19))) -0.12834523756042035)
  22.   (f2cl-lib:fset (f2cl-lib:fref by0cs (3) ((1 19))) -0.10437884799794249)
  23.   (f2cl-lib:fset (f2cl-lib:fref by0cs (4) ((1 19))) 0.023662749183969697)
  24.   (f2cl-lib:fset (f2cl-lib:fref by0cs (5) ((1 19))) -0.0020903916477004866)
  25.   (f2cl-lib:fset (f2cl-lib:fref by0cs (6) ((1 19))) 1.0397545393905724e-4)
  26.   (f2cl-lib:fset (f2cl-lib:fref by0cs (7) ((1 19))) -3.369747162423972e-6)
  27.   (f2cl-lib:fset (f2cl-lib:fref by0cs (8) ((1 19))) 7.729384267670667e-8)
  28.   (f2cl-lib:fset (f2cl-lib:fref by0cs (9) ((1 19))) -1.3249767726642597e-9)
  29.   (f2cl-lib:fset (f2cl-lib:fref by0cs (10) ((1 19))) 1.764823261540453e-11)
  30.   (f2cl-lib:fset (f2cl-lib:fref by0cs (11) ((1 19))) -1.8810550715801963e-13)
  31.   (f2cl-lib:fset (f2cl-lib:fref by0cs (12) ((1 19))) 1.6418654853661496e-15)
  32.   (f2cl-lib:fset (f2cl-lib:fref by0cs (13) ((1 19))) -1.1956594386046063e-17)
  33.   (f2cl-lib:fset (f2cl-lib:fref by0cs (14) ((1 19))) 7.377296297440186e-20)
  34.   (f2cl-lib:fset (f2cl-lib:fref by0cs (15) ((1 19))) -3.9068434767104365e-22)
  35.   (f2cl-lib:fset (f2cl-lib:fref by0cs (16) ((1 19))) 1.7955036644361577e-24)
  36.   (f2cl-lib:fset (f2cl-lib:fref by0cs (17) ((1 19))) -7.229627125448012e-27)
  37.   (f2cl-lib:fset (f2cl-lib:fref by0cs (18) ((1 19))) 2.571727931635169e-29)
  38.   (f2cl-lib:fset (f2cl-lib:fref by0cs (19) ((1 19))) -8.141268814163696e-32)
  39.   (setq first f2cl-lib:%true%)
  40.   (defun dbesy0 (x)
  41.     (declare (type double-float x))
  42.     (prog ((ampl 0.0) (theta 0.0) (y 0.0) (dbesy0 0.0))
  43.       (declare (type double-float dbesy0 y theta ampl))
  44.       (cond
  45.        (first
  46.         (setf nty0
  47.                 (initds by0cs 19
  48.                  (* 0.1f0 (f2cl-lib:freal (f2cl-lib:d1mach 3)))))
  49.         (setf xsml (f2cl-lib:fsqrt (* 4.0 (f2cl-lib:d1mach 3))))))
  50.       (setf first f2cl-lib:%false%)
  51.       (if (<= x 0.0) (xermsg "SLATEC" "DBESY0" "X IS ZERO OR NEGATIVE" 1 2))
  52.       (if (> x 4.0) (go label20))
  53.       (setf y 0.0)
  54.       (if (> x xsml) (setf y (* x x)))
  55.       (setf dbesy0
  56.               (+ (* twodpi (f2cl-lib:flog (* 0.5 x)) (dbesj0 x))
  57.                  0.375
  58.                  (dcsevl (- (* 0.125 y) 1.0) by0cs nty0)))
  59.       (go end_label)
  60.      label20
  61.       (multiple-value-bind
  62.           (var-0 var-1 var-2)
  63.           (d9b0mp x ampl theta)
  64.         (declare (ignore var-0))
  65.         (setf ampl var-1)
  66.         (setf theta var-2))
  67.       (setf dbesy0 (* ampl (sin theta)))
  68.       (go end_label)
  69.      end_label
  70.       (return (values dbesy0 nil)))))
  71.  
  72.